#
# @lc app=leetcode.cn id=1207 lang=python3
#
# [1207] 独一无二的出现次数
#
from typing import List


# @lc code=start
class Solution:
    def uniqueOccurrences(self, arr: List[int]) -> bool:
        bucket = {}
        for i in arr:
            if i in bucket:
                bucket[i] += 1
            else:
                bucket[i] = 1
        result = set()
        for i in bucket.values():
            if i in result:
                return False
            elif i != 0:
                result.add(i)
        return True


if __name__ == "__main__":
    s = Solution()
    print(s.uniqueOccurrences([1, 2, 2, 1, 1, 3]), True)
    print(s.uniqueOccurrences([1, 2]), False)
    print(s.uniqueOccurrences([-3, 0, 1, -3, 1, 1, 1, -3, 10, 0]), True)

# @lc code=end
